FROM ubuntu:22.04

# Install necessary system apt libs
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    curl \
    build-essential \
    pkg-config \
    libudev-dev \
    libpcap-dev \
    libglib2.0-dev \
    ca-certificates \
    libssl-dev \
    clang \
    # Adding GStreamer dependencies
    libgstreamer1.0-dev \
    gstreamer1.0-plugins-base \
    gstreamer1.0-plugins-good \
    gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-ugly \
    gstreamer1.0-tools \
    libgstreamer-plugins-base1.0-dev \
    # Clean up
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV CARGO_TERM_COLOR=always

# Install nextest
RUN curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin

# Install additional tools needed for the CI
RUN cargo install cargo-generate 

# Set environment variables for build modes and features
ENV FEATURES_FLAG="--features macro_debug,mock,perf-ui,image,kornia,python,gst,faer,nalgebra,glam,debug_pane,bincode"

# Set up entry environment
WORKDIR /home/copper-rs

# Default command
CMD ["/bin/bash"]
